home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-cameron-cmp-01.txt < prev    next >
Text File  |  1993-07-08  |  29KB  |  856 lines

  1.  
  2.  
  3.  
  4. Internet Draft                                           P. Cameron
  5.                                                            J. Bates
  6.                                        Xylogics, International Ltd.
  7.                                                          April 1993
  8.  
  9.  
  10.               Connection Multiplexing Protocol (CMP)
  11.  
  12. Status of this Memo
  13.  
  14.    This document is an Internet Draft.  Internet Drafts are working
  15.    documents of the Internet Engineering Task Force (IETF), its
  16.    Areas, and its Working Groups.  Note that other groups may also
  17.    distribute working documents as Internet Drafts.
  18.  
  19.    Internet Drafts are draft documents valid for a maximum of six
  20.    months.   Internet Drafts may be updated, replaced, or obsoleted
  21.    by other documents at any time.  It is not appropriate to use
  22.    Internet Drafts as reference material or to cite them other than
  23.    as a "working draft" or "work in progress."
  24.  
  25.    Please check the I-D abstract listing contained in each Internet
  26.    Draft directory to learn the current status of this or any other
  27.    Internet Draft.
  28.  
  29.    It is intended that this document will be submitted to the IESG
  30.    for consideration as a standards document.  Distribution of this
  31.    document is unlimited.
  32.  
  33.  
  34. Abstract
  35.  
  36.    One of the problems with terminal servers attached to a LAN is
  37.    the large number of small packets they can generate.
  38.    Frequently, most of these packets are destined for only one or
  39.    two hosts.  CMP is a protocol which allows multiple Telnet and
  40.    Rlogin connections, between a server and a host, to share a
  41.    single TCP connection.  With simple extensions this can be
  42.    expanded to include other TCP protocols.
  43.  
  44.  
  45. Acknowledgments
  46.  
  47.    This document is the work of many more contributors than just
  48.    the listed authors both here at Xylogics International and at
  49.    Xylogics Inc.  Specifically Jim Barnes, Gary Malkin, James
  50.    Carlson, Dave Hirst and Miguel Sasson.
  51.  
  52.    In addition, we would like to thank ICL Plc. in the U.K. and
  53.    Sweden for reviewing early versions of this proposal, and for
  54.    their assistance on early prototypes.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. Cameron, Bates           Expires: 1 Oct 93                 [Page 1]
  62.  
  63.  
  64.  
  65.  
  66.  
  67. Internet Draft                  CMP                      April 1993
  68.  
  69.  
  70.                           Table of Contents
  71.  
  72.    1.  Justification  . . . . . . . . . . . . . . . . . . . . .  2
  73.    2.  Overview . . . . . . . . . . . . . . . . . . . . . . . .  2
  74.    3.  Protocol Design  . . . . . . . . . . . . . . . . . . . .  3
  75.    3.1   Header Format  . . . . . . . . . . . . . . . . . . . .  3
  76.    3.2   Opening a Multiplexed Connection . . . . . . . . . . .  4
  77.    3.3   Opening a New Subconnection  . . . . . . . . . . . . .  7
  78.    3.4   Sending Data . . . . . . . . . . . . . . . . . . . . .  7
  79.    3.5   Urgent Data  . . . . . . . . . . . . . . . . . . . . .  8
  80.    3.6   Subconnection flow control . . . . . . . . . . . . . .  9
  81.    3.7   Closing a Subconnection  . . . . . . . . . . . . . . . 10
  82.    3.8   Closing a Multiplexed Connection . . . . . . . . . . . 11
  83.    3.9   Standard Error Codes . . . . . . . . . . . . . . . . . 11
  84.    4.  Multiplexed Messages . . . . . . . . . . . . . . . . . . 11
  85.    4.1   Construction . . . . . . . . . . . . . . . . . . . . . 11
  86.    4.2   Disassembly  . . . . . . . . . . . . . . . . . . . . . 12
  87.    5.  Security Considerations  . . . . . . . . . . . . . . . . 13
  88.    6.  Authors' Addresses . . . . . . . . . . . . . . . . . . . 13
  89.  
  90.  
  91. 1. Justification
  92.  
  93.    When network designers consider which protocols generate the
  94.    most load, they naturally tend to consider protocols which
  95.    transfer large blocks of data (e.g. FTP, NFS).  What is often
  96.    not considered is the load generated by Telnet and Rlogin
  97.    because of the assumption that users type slowly and the packets
  98.    are very small.  This is a grave underestimation on networks
  99.    which have many Telnet and Rlogin ports on multiple terminal
  100.    servers.
  101.  
  102.    The problem stems from the fact that the work a host must do to
  103.    process a 1-byte packet is very nearly as much as the work it
  104.    must do to process a 1500-byte packet.  That is, it is the
  105.    overhead of processing a packet which consumes a host's
  106.    resources, not the processing of the data.
  107.  
  108.    If one assumes that most users connected to a terminal server
  109.    will be connecting to only a few hosts, then it should be
  110.    obvious that the network and host load could be greatly reduced
  111.    if traffic from multiple users, destined for the same host,
  112.    could be sent in the same packet.
  113.  
  114.  
  115. 2. Overview
  116.  
  117.    CMP is designed to improve network utilization and reduce the
  118.    load on the hosts by multiplexing TCP connections which would
  119.    generate many small packets, onto a single TCP connection which
  120.    generates fewer larger packets.
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127. Cameron, Bates           Expires: 1 Oct 93                 [Page 2]
  128.  
  129.  
  130.  
  131.  
  132.  
  133. Internet Draft                  CMP                      April 1993
  134.  
  135.  
  136.    The following terminology is used throughout this document.
  137.  
  138.    Multiplexed Connection -
  139.       The actual TCP connection which exists between the server and
  140.       the client over which the subconnections exist.
  141.  
  142.    Subconnection -
  143.       The "virtual TCP" connection between processes on the server
  144.       and client which exists over the Multiplexed Connection.
  145.  
  146.    Message -
  147.       A single packet of data for a single subconnection plus its
  148.       header which is passed over the Multiplexed Connection.
  149.  
  150.    Endpoint -
  151.       One of the two ends of a subconnection.
  152.  
  153.    Multiplexed Message -
  154.       A packet which is sent over the Multiplexed Connection.  It
  155.       is constructed from multiple CMP messages for multiple
  156.       subconnections.
  157.  
  158.  
  159. 3. Protocol Design and Subconnection Messages
  160.  
  161.    CMP operates by prepending a 4 octet header onto each
  162.    subconnection's data, then appending that onto the end of the
  163.    packet which will be sent over the multiplexed connection.  Upon
  164.    receiving a message, the individual subconnection datastreams
  165.    are demultiplexed and the information is handed up to the
  166.    application.
  167.  
  168. 3.1 Header Format
  169.  
  170.    The 4 octet header has the following general format:
  171.  
  172.                   | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  173.                   +-----------+-------------------+
  174.                   |   TYPE    |     SIZE high     |
  175.                   +-----------+-------------------+
  176.                   |           SIZE low            |
  177.                   +-------------------------------+
  178.                   |      Dest ID (DID) high       |
  179.                   +-------------------------------+
  180.                   |      Dest ID (DID) low        |
  181.                   +-------------------------------+
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193. Cameron, Bates           Expires: 1 Oct 93                 [Page 3]
  194.  
  195.  
  196.  
  197.  
  198.  
  199. Internet Draft                  CMP                      April 1993
  200.  
  201.  
  202.    The TYPE field has the following values:
  203.       0 - data (DATA)
  204.       1 - urgent data pointer (URG_DATA_PTR)
  205.       2 - open subconnection (OPEN)
  206.       3 - reply to OPEN message (OPEN_RPLY)
  207.       4 - close subconnection (CLOSE)
  208.       5 - reply to CLOSE message (CLOSE_RPLY)
  209.       6 - credit update (CREDIT)
  210.    Value 7 is reserved for future use.
  211.  
  212.    For most commands, the SIZE field contains the number of octets
  213.    of 'data' following the header.  For messages of type DATA this
  214.    will be the number of data octets, for other messages, this will
  215.    be the number of octets contained in subsidiary header fields.
  216.    For the CREDIT message, this field contains the number of bytes
  217.    of new credit available for the receiving end to use.
  218.  
  219.    The DID is an arbitrary 16-bit number assigned by the receiving
  220.    end of a subconnection to identify the subconnection.  The
  221.    receiver of a message uses the DID to uniquely identify a
  222.    subconnection.  Note, this field is not used by the OPEN message
  223.    as no destination has been allocated.
  224.  
  225. 3.2 Opening a Multiplexed Connection
  226.  
  227.    The first time an application tries to open a TCP connection to
  228.    a remote host which has a CMP server, it first attempts to
  229.    create a Multiplexed Connection by opening the well known CMP
  230.    port, TBA.  If that attempt succeeds (i.e. a TCP connection is
  231.    established), an OPEN  message will then be sent by the clients
  232.    CMP process.  If the Multiplexed Connection cannot be
  233.    established, the client should open a standard TCP connection
  234.    directly to the specified remote port.
  235.  
  236.    The format of an OPEN message is:
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259. Cameron, Bates           Expires: 1 Oct 93                 [Page 4]
  260.  
  261.  
  262.  
  263.  
  264.  
  265. Internet Draft                  CMP                      April 1993
  266.  
  267.  
  268.                   | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  269.                   +-----------+-------------------+
  270.                   |     2     |        0          |
  271.                   +-----------+-------------------+
  272.                   |              6                |
  273.                   +-------------------------------+
  274.                   |              0                |
  275.                   +-------------------------------+
  276.                   |              0                |
  277.                   +-------------------------------+
  278.                   |      Source ID (SID) high     |
  279.                   +-------------------------------+
  280.                   |      Source ID (SID) low      |
  281.                   +-------------------------------+
  282.                   |        Dest port high         |
  283.                   +-------------------------------+
  284.                   |        Dest port low          |
  285.                   +-------------------------------+
  286.                   |     Initial Credit high       |
  287.                   +-------------------------------+
  288.                   |     Initial Credit low        |
  289.                   +-------------------------------+
  290.  
  291.    The SID is an arbitrary number, for example, it could be the
  292.    index into an internal table of connections. See discussion
  293.    below on the use of this field.  The TYPE is 2, indicating the
  294.    opening of a new, in this case first, subconnection.  The DID
  295.    field is not used as no destination has yet been allocated.  The
  296.    Dest Port is the well known TCP port number for the application
  297.    (e.g. 23 for Telnet).  The initial credit is the number of
  298.    octets of data that the endpoint opening the connection can
  299.    initially receive from the other endpoint.
  300.  
  301.    The receiver of the open message will respond with an OPEN_RPLY
  302.    message.  The format of an OPEN_RPLY message is:
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325. Cameron, Bates           Expires: 1 Oct 93                 [Page 5]
  326.  
  327.  
  328.  
  329.  
  330.  
  331. Internet Draft                  CMP                      April 1993
  332.  
  333.  
  334.                   | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  335.                   +-----------+-------------------+
  336.                   |     3     |        0          |
  337.                   +-----------+-------------------+
  338.                   |              6                |
  339.                   +-------------------------------+
  340.                   |      Dest ID (DID) high       |
  341.                   +-------------------------------+
  342.                   |      Dest ID (DID) low        |
  343.                   +-------------------------------+
  344.                   |      Source ID (SID) high     |
  345.                   +-------------------------------+
  346.                   |      Source ID (SID) low      |
  347.                   +-------------------------------+
  348.                   |     Initial Credit high       |
  349.                   +-------------------------------+
  350.                   |     Initial Credit low        |
  351.                   +-------------------------------+
  352.                   |     Error code (ERR) high     |
  353.                   +-------------------------------+
  354.                   |     Error code (ERR) low      |
  355.                   +-------------------------------+
  356.  
  357.    If the receiver cannot open the subconnection for any reason, it
  358.    will respond with an OPEN_RPLY message with a non-zero ERR field
  359.    (and a SID field of 0).  If the receiver succeeds in opening the
  360.    subconnection, the ERR field of the OPEN_RPLY will contain zero.
  361.    See section 3.9 for a list of standard error codes.  The initial
  362.    credit is the number of octets of data that the endpoint can
  363.    initially receive from the other endpoint.
  364.  
  365.    It is important to note the use of the SID fields in both the
  366.    OPEN and OPEN_RPLY messages.  This field is used to pass to the
  367.    other endpoint the value to be used in the DID field of all
  368.    subsequent messages sent back on this Subchannel.  In
  369.    particular, the DID field of the OPEN_RPLY message should be set
  370.    from the SID field of the OPEN message.
  371.  
  372.    Optionally having different DID fields in the two directions
  373.    allows the implementor of each end much greater freedom in the
  374.    use of the DID field, hence the opportunity to make the
  375.    implementation more efficient.  For example, if the endpoint has
  376.    a table of information about each open subconnection, then the
  377.    DID can be the index into this table.  This is a much more
  378.    efficient implementation than scanning the table and much easier
  379.    to implement than a hash table lookup.
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391. Cameron, Bates           Expires: 1 Oct 93                 [Page 6]
  392.  
  393.  
  394.  
  395.  
  396.  
  397. Internet Draft                  CMP                      April 1993
  398.  
  399.  
  400.    Thus, the sequence of messages and their SIDs and DIDs could be:
  401.  
  402.  
  403.         Endpoint 1          Endpoint 2
  404.         ----------          ----------
  405.  
  406.         TYPE=OPEN
  407.         --------------->
  408.         DID=0
  409.         SID=D1
  410.  
  411.                           TYPE=OPEN_RPLY
  412.                        <----------------
  413.                                   DID=D1
  414.                                   SID=D2
  415.  
  416.         TYPE=DATA
  417.         --------------->
  418.         DID=D2
  419.  
  420.                                TYPE=DATA
  421.                        <----------------
  422.                                   DID=D1
  423.  
  424.  
  425. 3.3 Opening a New Subconnection
  426.  
  427.    When a user on a client attempts to open a TCP connection to a
  428.    host server for which a Multiplexed Connection exists, the
  429.    client simply adds that TCP connection as a new subconnection by
  430.    sending an OPEN message and receiving back an OPEN_RPLY message
  431.    (see section 3.2).
  432.  
  433.    Once a Multiplexed Connection has been established, either side
  434.    may initiate an OPEN request.
  435.  
  436. 3.4 Sending Data
  437.  
  438.    Subconnection data is preceded by the following header:
  439.  
  440.                   | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  441.                   +-----------+-------------------+
  442.                   |     0     |    Length high    |
  443.                   +-----------+-------------------+
  444.                   |          Length low           |
  445.                   +-------------------------------+
  446.                   |      Dest ID (DID) high       |
  447.                   +-------------------------------+
  448.                   |      Dest ID (DID) low        |
  449.                   +-------------------------------+
  450.  
  451.    The DID is the identification for the subconnection.  The TYPE
  452.    is 0.  The SIZE field specifies the length of the data
  453.    immediately following the header; it does not include the length
  454.  
  455.  
  456.  
  457. Cameron, Bates           Expires: 1 Oct 93                 [Page 7]
  458.  
  459.  
  460.  
  461.  
  462.  
  463. Internet Draft                  CMP                      April 1993
  464.  
  465.  
  466.    of the header.
  467.  
  468. 3.5 Urgent Data
  469.  
  470.    TCP requires the ability to send individual octets marked as
  471.    "urgent" data.  When an application requests this, it expects
  472.    that the remote end of the communications stream is notified as
  473.    soon as possible that urgent data is pending, and it expects
  474.    that the remote end will be able to mark this octet and deliver
  475.    it either in-line or as out-of-band data.  This feature is
  476.    implemented over a Multiplexed Connection using an URG_DATA_PTR
  477.    message.  The format of the urgent data pointer message is:
  478.  
  479.                   | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  480.                   +-----------+-------------------+
  481.                   |    1      |         0         |
  482.                   +-----------+-------------------+
  483.                   |               2               |
  484.                   +-------------------------------+
  485.                   |      Dest ID (DID) high       |
  486.                   +-------------------------------+
  487.                   |      Dest ID (DID) low        |
  488.                   +-------------------------------+
  489.                   |    Urg Data Ptr (URG) high    |
  490.                   +-------------------------------+
  491.                   |    Urg Data Ptr (URG) low     |
  492.                   +-------------------------------+
  493.  
  494.    The DID is the identification for the subconnection.  The TYPE
  495.    is 1.  The URG field indicates the number of bytes of type DATA
  496.    (for this subconnection) which follow this URG_DATA_PTR message
  497.    upto and including the byte of urgent data being sent.
  498.  
  499.    Normally the urgent data byte will be queued behind any other
  500.    data waiting to be transmitted on this subconnection (see
  501.    section 4.1).  An URG_DATA_PTR message will be sent immediately,
  502.    indicating the number of data bytes waiting to be transmitted
  503.    upto and including the byte of urgent data on this
  504.    subconnection. This enables the receiver to be made aware that
  505.    there is urgent data queued even if there is no available
  506.    credit.
  507.  
  508.    If an application sends another octet of urgent data before a
  509.    previous one has been read, the receiver is expected to indicate
  510.    to its applications that there is urgent data present until the
  511.    last known piece of urgent data has been received by the user.
  512.  
  513.    Some implementations may choose to expedite the transmission of
  514.    data preceding and including the urgent data.
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523. Cameron, Bates           Expires: 1 Oct 93                 [Page 8]
  524.  
  525.  
  526.  
  527.  
  528.  
  529. Internet Draft                  CMP                      April 1993
  530.  
  531.  
  532. 3.6 Subconnection Flow Control
  533.  
  534.    CMP supports flow control on a subconnection basis to ensure
  535.    that a single subconnection can not tie up vast amounts of
  536.    resources to the detriment of the other subconnections.  Flow
  537.    control in CMP is accomplished by use of a credit/debit system.
  538.    Each endpoint knows the maximum number of octets of data
  539.    (contained in messages of type DATA) that the other endpoint is
  540.    able to receive, and may not send more than this number, it can
  541.    of course send less.  After sending a DATA message, the endpoint
  542.    should decrease its outstanding credit by the number of octets
  543.    just sent.  Once the other endpoint has processed the data, it
  544.    will send back CREDIT messages to tell the sending endpoint how
  545.    many more octets of data it can now receive.  Note, an endpoint
  546.    can send CREDIT messages when it wishes to, there are no
  547.    constraints on the timing, and it may not grant back to the
  548.    other endpoint all the credit it initially had (or it may grant
  549.    more).  The format of the CREDIT message is:
  550.  
  551.                   | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  552.                   +-----------+-------------------+
  553.                   |    6      | Extra credit high |
  554.                   +-----------+-------------------+
  555.                   |       Extra credit low        |
  556.                   +-------------------------------+
  557.                   |      Dest ID (DID) high       |
  558.                   +-------------------------------+
  559.                   |      Dest ID (DID) low        |
  560.                   +-------------------------------+
  561.  
  562.    The DID is the identification for the subconnection.  The TYPE
  563.    is 6.
  564.  
  565.    The extra credit field is the number of octets of data space
  566.    that have become available at the endpoint sending the message.
  567.    This value should be added to the credit value currently held.
  568.  
  569.    After an OPEN message, the credit available is given in the
  570.    initial credit field of the OPEN or OPEN_RPLY message.  It is
  571.    allowable to subsequently increase the total amount of credit
  572.    available, but it should never be reduced below the initial
  573.    value. This allows the sender to decide whether to send part of
  574.    a data block or to wait for further credit updates and to then
  575.    send the whole data block.
  576.  
  577.    It is suggested that credit update messages are sent on the back
  578.    of an outgoing multiplexed message. This allows a single credit
  579.    update message to reflect all of the credit that has become
  580.    available within a delay timer period. Thus reducing the risk of
  581.    Silly Window Syndrome.
  582.  
  583.    Only messages of type DATA are controlled by the credit/debit
  584.    system, all other messages can be sent at any time.
  585.  
  586.  
  587.  
  588.  
  589. Cameron, Bates           Expires: 1 Oct 93                 [Page 9]
  590.  
  591.  
  592.  
  593.  
  594.  
  595. Internet Draft                  CMP                      April 1993
  596.  
  597.  
  598. 3.7 Closing a Subconnection
  599.  
  600.    When one side of the subconnection wishes to close, it sends a
  601.    CLOSE message. This indicates that there is no more data to be
  602.    sent. After sending this message an endpoint MUST NOT send any
  603.    more data.  The side which receives the Close Request continues
  604.    to send data until there is no more data to be sent, at which
  605.    time it sends a CLOSE_RPLY message.  A CLOSE message has the
  606.    following format:
  607.  
  608.                   | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  609.                   +-----------+-------------------+
  610.                   |    4      |         0         |
  611.                   +-----------+-------------------+
  612.                   |               1               |
  613.                   +-------------------------------+
  614.                   |      Dest ID (DID) high       |
  615.                   +-------------------------------+
  616.                   |      Dest ID (DID) low        |
  617.                   +-------------------------------+
  618.                   |         Close type            |
  619.                   +-------------------------------+
  620.  
  621.    The DID is the identification for the subconnection.  The TYPE
  622.    is 4.
  623.  
  624.    The close type field contains the type of close to be done:
  625.  
  626.         0x00 Standard close
  627.         0x01 Reset.
  628.  
  629.  
  630.    A standard CLOSE will allow all data currently in transit to be
  631.    sent, but a reset CLOSE will cause this data to be flushed.
  632.  
  633.    The CLOSE_RPLY message has the following format:
  634.  
  635.                   | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  636.                   +-----------+-------------------+
  637.                   |    5      |         0         |
  638.                   +-----------+-------------------+
  639.                   |               2               |
  640.                   +-------------------------------+
  641.                   |      Dest ID (DID) high       |
  642.                   +-------------------------------+
  643.                   |      Dest ID (DID) low        |
  644.                   +-------------------------------+
  645.                   |     Error code (ERR) high     |
  646.                   +-------------------------------+
  647.                   |     Error code (ERR) low      |
  648.                   +-------------------------------+
  649.  
  650.    The DID is the identification for the subconnection.  The TYPE
  651.    is 5.  The ERR field is used to return an error code. A value of
  652.  
  653.  
  654.  
  655. Cameron, Bates           Expires: 1 Oct 93                [Page 10]
  656.  
  657.  
  658.  
  659.  
  660.  
  661. Internet Draft                  CMP                      April 1993
  662.  
  663.  
  664.    0 is used where the Close was successful, a non-zero value
  665.    indicates an error.  See section 3.9 for a list of error codes.
  666.  
  667.    A subconnection is not closed until one endpoint issues a CLOSE
  668.    Request, and the other endpoint responds with a CLOSE_RPLY
  669.    message. Note, the subconnection is closed on receipt of the
  670.    CLOSE_RPLY message, regardless of the value of the ERR field.
  671.  
  672.    Where the close type is 'reset' the receiver should send the
  673.    CLOSE_RPLY message immediately, it should not wait for data to
  674.    flush.
  675.  
  676.    If an endpoint sends a normal CLOSE message, and does not
  677.    receive a CLOSE_RPLY message it is permissible to send a second
  678.    CLOSE message with a 'close type' of 'reset'.  In this situation
  679.    it must be possible to cope with receiving either 1 or 2
  680.    CLOSE_RPLY messages.
  681.  
  682. 3.8 Closing a Multiplexed Connection
  683.  
  684.    When the last subconnection on a Multiplexed Connection has
  685.    closed, the Multiplexed Connection should also be closed, as any
  686.    TCP connection would be.
  687.  
  688. 3.9 Standard Error Codes
  689.  
  690.    The standard error codes to be used in the ERR field of the
  691.    OPEN_RPLY and CLOSE_RPLY messages are:
  692.  
  693.          ESUCCESS          0     Command completed successfully
  694.          ENXIO             5     No such device or address
  695.          ENOMEM            8     Not enough core
  696.          EACCES            9     Permission denied
  697.          EBUSY             10    Device busy
  698.          ENODEV            11    No such device
  699.          ESECURITY         54    Security fault
  700.          EMJOB             57    Job limit exceeded
  701.          ESECURITYERR      59    Security server is unreachable
  702.  
  703.    Any other non-zero values may also be used to signify an error
  704.    condition.
  705.  
  706.  
  707. 4. Multiplexed Messages
  708.  
  709.    A Multiplexed Message is the packet which is sent over the
  710.    Multiplexed Connection.  It is constructed from multiple CMP
  711.    messages for multiple subconnections.
  712.  
  713. 4.1 Multiplexed Message Construction
  714.  
  715.    When an application running over a subconnection sends a packet,
  716.    the CMP prepends that packet with a header to create a CMP
  717.    message, then appends the message to the Multiplexed Message
  718.  
  719.  
  720.  
  721. Cameron, Bates           Expires: 1 Oct 93                [Page 11]
  722.  
  723.  
  724.  
  725.  
  726.  
  727. Internet Draft                  CMP                      April 1993
  728.  
  729.  
  730.    under construction.
  731.  
  732.    When the first message to be transmitted is placed into the
  733.    Multiplexed Message under construction, a timer is started.
  734.    When the timer expires, all outstanding message are placed into
  735.    the Multiplexed Message and it is transmitted. This ensures that
  736.    all messages constructed before the timer expires are sent in a
  737.    single Multiplexed Message.  If during construction of the
  738.    Multiplexed Message the buffer holding the packet fills, the
  739.    Multiplexed Message is transmitted immediately.
  740.  
  741.    The delay time should be user configurable; a reasonable time is
  742.    20 to 30 milliseconds.  The time period wants to be large enough
  743.    to give a reasonable probability of sending multiple packets but
  744.    not so large that the echo response time becomes a problem.
  745.    This suggests that the upper limit for the timer is probably
  746.    1/10th second.  As the cost of using timeouts on many systems is
  747.    quite large it is recommended that a single timer is used and
  748.    that all connections are serviced on each expiry period. In
  749.    particular where a large timeout period is specified it is
  750.    probably wise to turn off the Nagle algorithm within TCP to stop
  751.    echo responses becoming unacceptable if there is light traffic.
  752.  
  753.    Additionally, configuration options may limit the number of
  754.    included data packets or the maximum size of the Multiplexed
  755.    Message before it is transmitted.
  756.  
  757.    If urgent data arrives for a subconnection, this is added to the
  758.    Multiplexed Message and an URG_DATA_PTR message is transmitted
  759.    immediately (see section 3.5).
  760.  
  761. 4.2 Multiplexed Message Disassembly
  762.  
  763.    When a Multiplexed Message is received, the CMP immediately
  764.    accepts it from TCP.  It is important to try and keep the TCP
  765.    connection drained so that the TCP window remains open. In the
  766.    event of TCP falling behind then all subconnections are delayed.
  767.    The CMP driver should honor TCP's flow control and ensure that
  768.    no data is lost or placed out of sequence.
  769.  
  770.    Each message in the Multiplexed Message (i.e. data message or
  771.    control message) is processed in turn.  The data contained in
  772.    DATA messages is sent to the applications as though they were
  773.    directly interfaced to TCP.  If only part of a DATA message is
  774.    received within a TCP packet it is implementation dependent as
  775.    to whether the partial block is passed on to the application
  776.    before the rest of the data is received.  If an URG_DATA_PTR
  777.    message is received the presence of urgent data will be
  778.    indicated to the applications in the same manner that TCP uses.
  779.    All other message types are dealt with by the CMP interface
  780.    layer.
  781.  
  782.    In the event of a protocol error then all subconnections should
  783.    be told to hangup and the TCP connection should be shutdown.
  784.  
  785.  
  786.  
  787. Cameron, Bates           Expires: 1 Oct 93                [Page 12]
  788.  
  789.  
  790.  
  791.  
  792.  
  793. Internet Draft                  CMP                      April 1993
  794.  
  795.  
  796. 5. Security Considerations
  797.  
  798.    If a site's security is instituted on an host-to-host basis, CMP
  799.    does not introduce a security problem.  If security exists on a
  800.    per connection basis, CMP would need to provide a mechanism for
  801.    allowing or disallowing certain users access to a multiplexed
  802.    connection.  Such a mechanism could be added, but is beyond the
  803.    scope of this document.
  804.  
  805.  
  806. 6. Authors' Addresses
  807.  
  808.    Peter Cameron and Julian Bates
  809.    Xylogics International Ltd.
  810.    Featherstone Road
  811.    Wolverton Mill
  812.    Milton Keynes
  813.    MK12 5RD
  814.    UK
  815.  
  816.    Phone: +44 908 222112
  817.    Fax:   +44 908 222115
  818.    Email: cmp-id@xylint.co.uk
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853. Cameron, Bates           Expires: 1 Oct 93                [Page 13]
  854.  
  855.  
  856.